﻿using STHPMS1.BLL.B_Core;
using STHPMS1.ICore.I_BLL.Bus;
using STHPMS1.ICore.I_Entity.Info;
using STHPMS1.ICore.I_Entity.Stmpms1;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;

namespace STHPMS1.BLL.B_Bus
{
    public class Dp_Sejud_CalcuBus : BllBase, IDp_Sejud_CalcuBill
    {
        public void Save<T>(T entity)
            where T : class ,IDp_Sejud_Calcu
        {
            if (this.Scene.Dal.Sthpms1.Update(entity) == 0)
            {
                this.Scene.Dal.Sthpms1.Insert(entity);
            }
        }

        public void Remove(IDp_Sejud_Calcu entity)
        {
            this.Scene.Dal.Sthpms1.Delete(entity);
        }

        public IEnumerable<T> Get<T>(Expression<Func<T, bool>> predicate, IPagingInfo info)
            where T : class, IDp_Sejud_Calcu
        {
            return this.Scene.Dal.Sthpms1.Select<T>(predicate, info);
        }

        /// <summary>
        /// 计算评判系数：复选措施评判系数计算表
        /// </summary>
        /// <param name="rdwayid"></param>
        /// <param name="measini"></param>
        /// <returns></returns>
        public double GetJUDGE_COEF(string rdwayid, string measini)
        {
            return this.Scene.Dal.Sthpms1.Dp_Sejud_Calcu.GetJUDGE_COEF(rdwayid, measini);
        }

    }
}
